package com.news.cloud.web;

import com.news.cloud.exception.ServerTechnicalException;
import com.news.cloud.service.ChannelService;
import com.news.cloud.web.model.ChannelPageResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by hiephn on 2014/08/28.
 */
@Controller
@RequestMapping("/channel")
public class ChannelController {

    @Autowired
    private ChannelService channelService;

    @RequestMapping(produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public ChannelPageResponse get() throws ServerTechnicalException {
        ChannelPageResponse channelPageResponse = channelService.get();
        return channelPageResponse;
    }
}
